DXL - oleRtf function

I am trying to use the oleRft function and in the DXL manual this function has the format of:

Buffer oleRTF(EmbeddedOleObject, Buffer&)

In searching Developers forum, I have found this format:

 Buffer oleRTF(EmbeddedOleObject)

 

I have tried to use both formats and neither works.

 

Here is the code sample:

 

Module my_Module = current
Object my_Object
string EOL = "\n"
RichText rtf
string s
Buffer OLE_RTF
EmbeddedOleObject ole


for my_Object in my_Module do
{
 if (! (null(my_Object."Object Text")))
 {
  s = richTextWithOle(my_Object."Object Text")
  for rtf in s do
  {
   if (rtf.isOle)
   {
    ole = rtf.getEmbeddedOle
    OLE_RTF = oleRtf(ole)
    print "OLE Found; ID - " my_Object."Absolute Number" EOL
   }
  }
     
 }

}

ack "Done"

 

 


WilliamFetech - Thu Jun 26 09:23:48 EDT 2014

Re: DXL - oleRtf function
llandale - Thu Jun 26 16:05:30 EDT 2014

You need to create the Buffer, perhaps at line 6.

  • Buffer OLE_RTF = create()

delete it at the bottom.

oleRtf(ole) returns a string not a "Buffer", the Developer's forum is wrong.  So what you have works; putting a string into the Buffer. ..err.. the previously created buffer:

  • OLE_RTF = oleRtf(ole)

oleRtf(ole, &Buffer) returns a handle on the Buffer call parameter, so it doesn't make sense to use that as a function, so if you want you can do this instead:

  • oleRtf(ole, OLE_RTF)

-Louie